%%%-------------------------------------------------------------------
%%% @author Administrator
%%% @copyright (C) 2020, <COMPANY>
%%% @doc
%%%
%%% @end
%%% Created : 09. 1月 2020 13:17
%%%-------------------------------------------------------------------
-module(game_assist_test).
-author("Administrator").

-include_lib("eunit/include/eunit.hrl").

profit_calculation_test() ->
  PlayerId = "12345",
  LeftScore = 10,
  Score = 5,
  Data = #{
    playerResult=>#{
      list_to_atom(PlayerId)=>#{leftScore=>LeftScore,score=>Score}
    }
  },
  Ret = game_assist:profit_calculation(PlayerId,Data),
  ?assert({LeftScore,Score} =:= Ret orelse {0,0} =:= Ret ).

threshold_test()->
  ?assert(game_assist:threshold(10,20)),
  ?assertNot(game_assist:threshold(20,10)).












